CaptureVis
CaptureVis CameraMask
 
Parameters:

    CameraMask = The Visible in Camera Mask value for the captured gfx commands
Returns: NONE
 

      CaptureVis sets the visibility of any following captured graphic commands will use. By default all graphics are set to be visible from all cameras.

      To selectively limit the visibility of captured items, you must specify which camera or cameras the item should be visible within. You do this by combining the bit values (from the list bellow) that represent each camera.

[ Camera Bits ]

1 = Camera #1 (bit 0)
2 = Camera #2 (bit 1)
4 = Camera #3 (bit 2)
8 = Camera #4 (bit 3)
16 = Camera #5 (bit 4)
32 = Camera #6 (bit 5)
64 = Camera #7 (bit 6)
128 = Camera #8 (bit 7)
256 = Camera #9 (bit 8)
512 = Camera #10 (bit 9)
1024 = Camera #11 (bit 10)
2048 = Camera #12 (bit 11)
4096 = Camera #13 (bit 12)
8092 = Camera #14 (bit 13)
16348 = Camera #15 (bit 14)
32768 = Camera #16 (bit 15)


      For example, to make a sprite visible only from camera #1 and camera #8, you'd add the values (1 + 128).




FACTS:


      * CaptureVis values must be positive (0 and higher)

      * To make items visible to all cameras again set CaptureVis with 65535 (ie. CaptureVis 65535)





Mini Tutorial:


      This example first creates two cameras. Then it captures a bunch of random dots and circles to the scene buffer. The dots are set so they will only be visible from camera #1 and vice versa for the circles in camera #2.


  
  
; Get the SCreen Width/height
  W=GetScreenWidth()
  h=GetScreenHeight()
  cw=w/2
  
  
; Create Camera #1, set it's cls colour to BLUE and set it's
; viewport so it's down the right hand side of the screen
  CreateCamera 1
  CameraViewPort 1,0,0,cw,h
  CameraClsColour 1,RGB(100,0,0)
  
  
  
; Create Camera #2, set it's cls colour to BLUE and set it's
; viewport so it's down the right hand side of the screen
  CreateCamera 2
  CameraViewPort 2,cw,0,w,h
  CameraClsColour 2,RGB(0,0,100)
  
  
  
; redirect all drawing to the scane buffer
  CaptureToScene
; clear the scene buffer
  ClsScene
  
  
; Set The capture Visible to camera 1 only
  CaptureVis 1
  
; Capture some Dots.
  For lp=0 To 100
     Dot Rnd(cw),Rnd(h)
  Next
  
  
; Set The capture Visible to Camera 2 only
  CaptureVis 2
  
; Capture some Circles.  While these circles are captured
; into the scene buffer with the previous dots.  Since CaptureVis
; has been set to camera 2, they will  only visible from within
; camera #2
  For lp=0 To 100
     Circle Rnd(cw),Rnd(h),Rnd(5),1
  Next
  
  
; DRaw All cameras
  DrawAllCameras
  
  
; display the screen and wait for a key to be pressed
  Sync
  WaitKey
  
  
  





 
Related Info: CameraBasics | CaptureDepth | CaptureToScene | ClsScene | DrawCamera | GetCaptureVis :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com